package com.suray.wcs.service.enums;

import com.suray.basic.wcs.utils.IBaseEnum;

import java.io.Serializable;

/**
 * netAddress 类型
 */
public enum NetAddressType implements IBaseEnum<Serializable> {
    HK_AGV(1, "海康AGV"),
    SEER_AGV(2, "仙工AGV"),
    UPPER_STRATA(3, "上层系统"),
    RGV_SON(4, "子车"),
    ;

    private int value;
    private String des;
    NetAddressType(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public Integer getValue() {
        return value;
    }

    @Override
    public String toString() {
        return des;
    }

    @Override
    public String getDescription() {
        return des;
    }

    @Override
    public Serializable getVal() {
        return null;
    }

    public static NetAddressType parsePlcDeviceType(int deviceType) {
        NetAddressType[] Types = NetAddressType.values();
        for (NetAddressType type : Types) {
            if (type.value == deviceType) {
                return type;
            }
        }
        throw new IllegalArgumentException("设备类型参数错误:" + deviceType);
    }
}
